from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from flask import session
from info import create_app, db,models
# 通过指定的配置名字创建对应的app
# create_app类似于工厂方法
app = create_app('development')
manager = Manager(app)
# 将app与db关联
Migrate(app, db)
# 将迁移命令添加到manager中
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    print(app.url_map)
    manager.run()



